# Use mirror source for better connectivity in China
source 'https://cdn.cocoapods.org/'

require Pod::Executable.execute_command('node', ['-p',
  'require.resolve("react-native/scripts/react_native_pods.rb", {paths: [process.argv[1]]},)', __dir__]).strip

platform :ios, min_ios_version_supported
prepare_react_native_project!

# 使用动态框架
use_frameworks! :linkage => :dynamic

target 'imageEditor' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    :app_path => File.dirname(__dir__),
    :hermes_enabled => true
  )
  
  # HXPhotoPicker 配置
  pod 'HXPhotoPicker', :path => '../HXPhotoPicker'
  
  post_install do |installer|
    react_native_post_install(installer, config[:reactNativePath], :mac_catalyst_enabled => false)
    
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '5.0'
        config.build_settings['ENABLE_BITCODE'] = 'NO'
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
      end
    end
  end
end
